package com.atguigu.springcloud.controller;

import com.atguigu.springcloud.entities.CommonResult;
import com.atguigu.springcloud.entities.Payment;
import com.atguigu.springcloud.service.PaymentFeignService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author ：pkq
 * @date ：Created in 2022/1/5 15:43
 * @description：
 * @modified By：
 * @version: $
 */
@RestController
public class OrderFeignController {

    @Autowired
    private PaymentFeignService paymentFeignService;


    @GetMapping(value = "/consumer/payment/get/{id}")
    public CommonResult<Payment> getPaymentById(@PathVariable("id") Long id){
        CommonResult<Payment> result = paymentFeignService.getPaymentById(id);
        return result;
    }


    @GetMapping(value = "/consumer/payment/feign/timeout")
    public String paymentFeignTimeOut(){

        String s = paymentFeignService.paymentFeignTimeOut();
        return s;
    }



}
